package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.ConsolidationMapper;
import com.youlai.boot.system.mapper.MaintenanceMapper;
import com.youlai.boot.system.model.QB.Maintenance;
import com.youlai.boot.system.service.MaintebaceService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
@Service
public class MaintenanceServiceImpl extends ServiceImpl<MaintenanceMapper, Maintenance>  implements MaintebaceService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private MaintenanceMapper maintenanceMapper;
    @Override
    public boolean saveMedicine(Maintenance maintenance) {

        maintenance.setAddtime(LocalDateTime.now());
        return save(maintenance);
    }

    @Override
    public List<Maintenance> getAllMedicine() {
        return maintenanceMapper.selectList(null);
    }

    @Override
    public boolean deleteMedicineById(Integer id) {
        return maintenanceMapper.deleteById(id) > 0;
    }
}
